<%@ page language="java" pageEncoding="UTF-8"%>
<div ng-controller="BlogEditController">
	<form role="form" callback="save" validate>
		<div class="form-group">
			<label>
				标题
			</label>
			<input type="text" class="form-control" placeholder="请输入标题" name="name" ng-model="blog.title" rule="required;">
		</div>
		<div class="form-group">
			<label>
				排序
			</label>
			<select class="form-control" ng-model="blog.order.id">
				<option ng-repeat="order in orders" value="{{order.id}}" ng-selected="{{order.id==blog.order.id}}">
					{{order.name}}
				</option>
			</select>
		</div>
		<div class="form-group">
			<label>
				目录
			</label>
			<select class="form-control" ng-model="blog.catalog.id">
				<option ng-repeat="catalog in catalogs" value="{{catalog.id}}" ng-selected="{{catalog.id==blog.catalog.id}}">
					{{catalog.name}}
				</option>
			</select>
		</div>
		<div class="form-group">
			<label>
				选项
			</label>
			<br/>
			<label class="btn btn-default">
				<input type="checkbox" ng-model="blog.oneself" ng-checked="blog.oneself==true"> 私有
			</label>
			
			<label class="btn btn-default">
				<input type="checkbox" ng-model="blog.comment" ng-checked="blog.comment==true"> 允许评论
			</label>
		</div>
		
		<div class="form-group">
			<label>
				内容
			</label>
			<textarea name="content" rule="required;length[5]" ng-model="blog.content" editor-width="100%;" editor></textarea>
		</div>
		<button type="submit" class="btn btn-success btn-sm">
			<i class="glyphicon glyphicon-ok-sign"></i> 保存
		</button>
	</form>
</div>